Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

Support for Empty namespace name for java classes without package - #520

Merged
jonpryor merged 3 commits into
masterfrom
gugavaro_namespace
Nov 12, 2019
Merged

Support for Empty namespace name for java classes without package#520
jonpryor merged 3 commits into
masterfrom
gugavaro_namespace

Conversation

@gugavaro

@gugavaro gugavaro commented Nov 8, 2019

Copy link
Copy Markdown
Contributor

Generator currently generates invalid code if we try to bind a java library that contains classes/interfaces defined without/outside a java package.

The current behavior generates the following invalid code:


namespace  {

	// Metadata.xml XPath class reference: path="/api/package[@name='']/class[@name='Animal']"
	[global::Android.Runtime.Register ("/Animal", DoNotGenerateAcw=true)]
	public partial class Animal : global::Java.Lang.Object {
...

that will fail to build for obvious reasons.

Fix is to validate that classes and interfaces belong to a package/namespace. In case namespace does not exist, we should generate class or interface without any namespace.

Tests were added to validate scenario

tracking issue: #519

@jonpryor
jonpryor merged commit 09083d9 into master Nov 12, 2019
@jonpryor
jonpryor deleted the gugavaro_namespace branch November 12, 2019 15:38
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants